<template>
    <div class="card-page">
        <el-row :gutter="12" type="flex">
            <el-col :span="12">
                <el-card shadow="always">
                    <template #header v-if="title">  <span>{{title}}</span> </template>
                    <kv label="名称">
                        <el-input v-model="info.name" chk="*" />
                    </kv>
                    <kv label="编码">
                        <el-input v-model="info.code" />
                    </kv>
                </el-card>
            </el-col>

        </el-row>
    </div>
</template>

<script setup>
/**
 * Created by CodeGenerator  at 2024-01-28 10:06:33
 */



defineOptions({
    name: "deploy-sheet-ref",
    inheritAttrs: true,
});

//定义 vue2的this,当前组件
const $self = getCurrentInstance();

//定义 $attrs
const $attrs = useAttrs();



//定义data
const $data = reactive({"info":{}});
const info = $computed(()=> $data.info );

const $props = defineProps({
    id: { type: String } ,
    action: { type: String } ,
    title : { type: String }
});

const action_name = $computed(()=>{
    return {add: "添加", edit: "修改"}[$props.action]
});
const $model = defineModel({ type: Object });



const list = ref();

//定义事件
const $emit = defineEmits(["update:modelValue","loaded"]);







watch($model, function(v) {
    if( $data.info == v) return;
    $data.info = v;
} ,{ immediate:true });
watch(info, function(v) {
    if( $data.info == v) return;
    $emit("update:modelValue",v)
} ,{ immediate:true });

</script>

<style scoped lang="scss">
</style>